﻿<Window x:Class="SmartMeterParamSetting.UI.UI_Config"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="系统设置" Height="335" Width="603" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" ShowActivated="False">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <TabControl Name="tabControl" Grid.Row="0">
            <TabItem Header="综合信息设置">
                <Grid Margin="2,5,2,2" Name="Grid_System">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <GroupBox Grid.Row="0" Header="操作相关信息" Margin="5">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0"  Orientation="Horizontal">
                                <TextBlock Margin="10,5,2,2" Text="加密机地址："/>
                                <TextBox Margin="0,2,2,2" Name="Txt_Adress" Text="{Binding Path=MachineAddr,UpdateSourceTrigger=PropertyChanged}" Width="120" />
                                <TextBlock Margin="10,5,2,2" Text="加密机端口："/>
                                <TextBox Margin="0,2,2,2" Name="Txt_Port" Text="{Binding Path=MachinePort,UpdateSourceTrigger=PropertyChanged}" Width="100"/>
                            </StackPanel>
                            <StackPanel Grid.Row="1"  Orientation="Horizontal">
                                <TextBlock  Margin="21,5,2,2" Text="密码等级："/>
                                <TextBox Margin="0,2,2,2" Name="Txt_Level" Text="{Binding Path=PwdLevel, UpdateSourceTrigger=PropertyChanged}" Width="40"/>
                                <TextBlock  Margin="10,5,2,2" Text="密码："/>
                                <TextBox Margin="0,2,2,2" Name="Txt_Pwd" Text="{Binding Path=WritePwd,UpdateSourceTrigger=PropertyChanged}" Width="100"/>
                                <TextBlock  Margin="10,5,2,2" Text="操作者代码："/>
                                <TextBox Margin="0,2,2,2" Name="Txt_UserCode" Text="{Binding Path=UserCode,UpdateSourceTrigger=PropertyChanged}" Width="100"/>
                            </StackPanel>
                            <StackPanel Grid.Row="2" Orientation="Horizontal">
                                <CheckBox Margin="10,5,0,5" Name="Chk_YuanCheng" IsChecked="{Binding Path=IsYuanCheng,UpdateSourceTrigger=PropertyChanged}" Content="打开远程费控"/>
                                <TextBlock Text="身份认证类型：" VerticalAlignment="Center" Margin="20,0,0,0"/>
                                <ComboBox Name="Cmb_IdentityType"  Width="120" Height="20" VerticalAlignment="Center" Text="{Binding Path=IdentityType,UpdateSourceTrigger=PropertyChanged}"/>
                            </StackPanel>
                        </Grid>
                    </GroupBox>
                    <GroupBox Grid.Row="2" Header="方案服务配置" Margin="5,0,5,5">
                        <DockPanel LastChildFill="True">
                            <TextBlock Margin="10,5,2,2"  Text="方案服务器地址："/>
                            <TextBox Margin="0,2,2,2" Name="Txt_FaServer" Text="{Binding Path=FaServer,UpdateSourceTrigger=PropertyChanged}" />
                        </DockPanel>
                    </GroupBox>

                    <GroupBox Header="通信配置" Grid.Row="1">
                        <Grid >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="25*"/>
                                <ColumnDefinition Width="25*"/>
                                <ColumnDefinition Width="25*"/>
                                <ColumnDefinition Width="25*"/>
                            </Grid.ColumnDefinitions>

                            <Label Content="帧间读取超时(ms):" Grid.Row="0" Grid.Column="0"/>
                            <TextBox Name="tbFrameTimeOut" Text="{Binding Path=FrameTimeOut,UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="1"/>

                            <Label Content="帧内读取超时(ms):" Grid.Row="0" Grid.Column="2"/>
                            <TextBox Name="tbBitTimeOut" Text="{Binding Path=BitTimeOut,UpdateSourceTrigger= PropertyChanged}" Grid.Row="0" Grid.Column="3"/>

                            <Label Content="所有发送延时(ms):" Grid.Row="1"/>
                            <TextBox Name="tbSendDelay" Grid.Row="1" Grid.Column="1" Text="{Binding Path=SendDelay,UpdateSourceTrigger=PropertyChanged}" />
                        
                            <Label Content="误差板发送延时(ms):" Grid.Row="1" Grid.Column="2"/>
                            <TextBox Name="tbWcbDelay" Grid.Row="1" Grid.Column="3" Text="{Binding Path=WcbDelay,UpdateSourceTrigger=PropertyChanged}"/>
                        </Grid>
                    </GroupBox>
                </Grid>
            </TabItem>
            <TabItem Header="装置设备设置" Name="TabDevice"/>
        </TabControl>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Margin="0,3,10,3" Name="Btn_OK" Content="确      定" Width="120" Click="Btn_OK_Click"/>
            <Button Margin="0,3,5,3" Name="Btn_Cancel" Content="关      闭" Width="120" Click="Btn_Cancel_Click"/>
        </StackPanel>
    </Grid>
</Window>
